function dist = latlong_to_feet(fromLat,fromLon,toLat,toLon)

% INPUT:
%   fromLat,fromLon - first set of lat/lon coordinates
%   toLat,toLon - second set of lat/lon coordinates

% OUTPUT:
%   dist - the distance between the two sets of coordinates given in feet

EARTHRADIUS = 3963; % earth radius in miles

fromLat = fromLat/180*pi;
fromLon = fromLon/180*pi;
toLat = toLat/180*pi;
toLon = toLon/180*pi;

from = [cos(fromLat)*cos(fromLon) cos(fromLat)*sin(fromLon) sin(fromLat)];
to = [cos(toLat)*cos(toLon); cos(toLat)*sin(toLon); sin(toLat)];

angle = acos(from*to);

dist = 5280*angle*EARTHRADIUS;